Subject: Re: image and brush hassle
From: Mike Sikorsky <[email-masked]>
Cc: [email-masked]
Date: Thu, 16 Sep 1993 19:17:05 +0700 (MST)

[ ..description of problem deleted..]
> 
> My theory is to do a histogram of the main image. Find which colours are
> not being used. Then remap the brush colours into the blank ones and end
> up with a nice clean combined palette.
> 
	The problem with this is that Remaping can be very very slow...
even computing the histogram will take a while on a normal screen...

> The brush is either a two or four colour variety only and the image will
> normally be either 8 or 16 colours.
>
	One thing is you could load the Image into a 16/32 color screen
so that the top 8/16 colors would be free... so now you could either have
the brush designed using the top range of colors or you could re-map it.

	If you choose the re-mapping way it can be done fast by just 
copying the bitplanes... ie:

+-------+ Main Screen= 32 colors --> 5 bitplanes
|320x200| so if you had a 4 color brush ( 2 bitplanes ) you would want colors
|       | to be re-maped like this --> { 0,1,2,3 } --> { 16,17,18,19 }
+-------+

0: %00000   16: %10000  ---> from this you can see that all you have to do
1: %00001   17: %10001       to remap the colors is fill the 5th bitplane
2: %00010   18: %10010       with $FFFFFFFF which is very quick...
3: %00011   19: %10011 

 **  Fill Phybase(4) to Phybase(4)+(320*200)/8,$FFFFFFFF **

of course you are going to have to do the re-mapping on a temp screen
then transfer it over... one problem may arise with masking... if you
did require that color 0 was to be masked then now it will have to be
color 16 that has to be masked... i wrote a routine to make a mask for
Icons of any color which I will be sending to Andrew Church but if you
need this earlier just ask...

hope this helps...

	- Mike Sikorksy <[email-masked]>

P.S. I have never done anything with the Dual Playfield stuff but that
     also may work.. it depends on how it works the colors.. I can never
     remember..

> Any ideas anyone.
> 
> Yours
> 	Tom Duncan
> 	[email-masked]
> 	University of Southern Queensland
> 	Toowoomba, Queensland.
> 
>